package com.shenglue.ssi.service;

import java.util.List;

import com.shenglue.ssi.dao.BuyInMainDao;
import com.shenglue.ssi.dao.SuppDao;
import com.shenglue.ssi.domain.BuyInMain;
import com.shenglue.ssi.domain.Supp;

public class BuyInMainServiceImpl implements BuyInMainService {

	private BuyInMainDao buyInMainDao;
	private SuppDao		 suppDao;

	public BuyInMainDao getBuyInMainDao() {
		return buyInMainDao;
	}

	public void setBuyInMainDao(BuyInMainDao buyInMainDao) {
		this.buyInMainDao = buyInMainDao;
	}

	public SuppDao getSuppDao() {
		return suppDao;
	}

	public void setSuppDao(SuppDao suppDao) {
		this.suppDao = suppDao;
	}

	/**
	 * 查询所有入库单主表信息
	 */
	public List<BuyInMain> selectAllBuyInMain() {
		return buyInMainDao.selectAllBuyInMain();
	}

	/**
	 * 按条件查询 入库单主表信息
	 */
	public List<BuyInMain> selectBuyInMainByCond( BuyInMain buyInMain ) {
		return buyInMainDao.selectBuyInMainByCond( buyInMain );
	}

	/**
	 * 增加入库单主表记录
	 */
	public boolean saveBuyInMain(BuyInMain buyInMain){
		return buyInMainDao.saveBuyInMain(buyInMain);
	}

	/**
	 * 删除入库单主表记录
	 */
	public boolean deleteBuyInMain(int buyInId) {
		return buyInMainDao.deleteBuyInMain( buyInId );
	}

	/**
	 * 修改入库单主表记录
	 */
	public boolean updateBuyInMain(BuyInMain buyInMain){
		return buyInMainDao.updateBuyInMain(buyInMain);
	}

	/**
	 * 为修改，根据 Id 查一条 入库单主表记录
	 */
	public BuyInMain getOneBuyInMainForUpdate( int buyInId ){
		return buyInMainDao.getOneBuyInMainForUpdate( buyInId );
	}

	/**
	 * 查询所有供应商信息
	 */
	public List<Supp> selectAllSupp() {
		return suppDao.selectAllSupp();
	}

}
